import { Form, Input, Button, Checkbox } from 'antd';
import React, { useState, useEffect, useRef, FC } from 'react';
import { FormInstance } from 'antd/es/form';
import { connect, Dispatch } from 'umi';
// import { LoginEnum } from '@/utils/constant'
interface LoginProps {
  dispatch?: any;
}

const FriendList: FC<LoginProps> = (props) => {
  console.log(props, 'dispatch');
  const [data, setData] = useState<any>({ list: [], total: 0 });
  useEffect(() => {
    props.dispatch({
      type: 'friend/fetchGetMessageList',
      payload: { pagesize: 30 },
    });
  }, []);
  //   // 发送短信
  //   const onFinish = (values: any) => {
  //     const {email,password,username}  = values

  //     const data = { email: values.username };
  //     // 邮箱登录
  //     dispatch({
  //       type: 'login/fetchEmiLogin',
  //       payload: {email,password},
  //     });
  //   };

  const onFinishFailed = (errorInfo: any) => {
    console.log('校验失败', errorInfo);
  };

  return <div>222</div>;
};

const mapState = (state: any) => {
  return { ...state };
};

export default connect(mapState)(FriendList);
